Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smarter helper rules #682

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Smarter helper rules #682

wants to merge 7 commits into from

Conversation

yihozhang
Copy link
Collaborator

@yihozhang yihozhang commented Nov 23, 2024

Eggcc has been constantly blowing up with the giant analyses our helpers generate. But do our helpers really need to generate that many facts? We explore the question in this PR.

  • Get and TypeList-ith are quadratic

:ruleset type-helpers)

(function TypeList-length (TypeList) i64 :unextractable)
(function TypeList-ith (TypeList i64) BaseType :unextractable)
(function TypeList-suffix (TypeList i64) TypeList :unextractable)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old TypeList-suffix based implementation is quadratic in the size of the list (which easily goes to 20+)

(rule ((Get expr i))
((union (Single (Get expr i))
(SubTuple expr i 1)))
; ;; This rule makes sure every tuple can be
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is actually unnecessary because we are already generating gets for every "important" tuple. Removed in my new PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant